package net.betou.trade.entity.main.base;

import java.io.Serializable;
import java.util.Date;

import net.betou.trade.entity.main.AgentAndAdmins;
import net.betou.trade.entity.main.Channel;

public abstract class BaseChannel implements Serializable{

private static final long serialVersionUID = 5172252495500417407L;
	
	public BaseChannel( ) {
		
	}
	
	private Integer id;
	 
	private String name;   // 分类名称
	private Date addDate; // 添加时间
	private Integer priority;  // 排序
	
	private String orientedGroup; //  面向的用户组
	private String smsGroup; // 短信发送用户组
	private Integer deep;
	
	// many to one
	private Channel parent; // 上级
	private AgentAndAdmins admin; // 所属用户
	
	
	
	private int hashCode = Integer.MIN_VALUE;
	
	public boolean equals( Object obj ) {
		if( null == obj )
			return false;
		if( !( obj instanceof Channel ) )
			return false;
		else{
			Channel type = ( Channel ) obj;
			if( null == this.getId( ) || null == type.getId( ) )
				return false;
			else
				return( this.getId( ).equals( type.getId( ) ) );
		}
	}

	public int hashCode( ) {
		if( Integer.MIN_VALUE == this.hashCode ){
			if( null == this.getId( ) )
				return super.hashCode( );
			else{
				String hashStr = this.getClass( ).getName( ) + ":" + this.getId( ).hashCode( );
				this.hashCode = hashStr.hashCode( );
			}
		}
		return this.hashCode;
	}

	public Integer getId( ) {
		return id;
	}

	public void setId( Integer id ) {
		this.id = id;
	}

	public String getName( ) {
		return name;
	}

	public void setName( String name ) {
		this.name = name;
	}

	public Date getAddDate( ) {
		return addDate;
	}

	public void setAddDate( Date addDate ) {
		this.addDate = addDate;
	}

	public Integer getPriority( ) {
		return priority;
	}

	public void setPriority( Integer priority ) {
		this.priority = priority;
	}

	public Channel getParent( ) {
		return parent;
	}

	public void setParent( Channel parent ) {
		this.parent = parent;
	}

	public AgentAndAdmins getAdmin( ) {
		return admin;
	}

	public void setAdmin( AgentAndAdmins admin ) {
		this.admin = admin;
	}

	public String getOrientedGroup( ) {
		return orientedGroup;
	}

	public void setOrientedGroup( String orientedGroup ) {
		this.orientedGroup = orientedGroup;
	}

	public Integer getDeep( ) {
		return deep;
	}

	public void setDeep( Integer deep ) {
		this.deep = deep;
	}

	public String getSmsGroup( ) {
		return smsGroup;
	}

	public void setSmsGroup( String smsGroup ) {
		this.smsGroup = smsGroup;
	}

	
	
}